package com.oneinlet

import java.math.BigDecimal

/**
 * Created by WangZiHe on 2018/12/10/010
 * QQ/WeChat:648830605
 * QQ-Group:368512253
 * Blog:www.520code.net
 * Github:https://github.com/yancheng199287
 */
open class User {
    var id: Int = 0
    var name: String? = "默认名字"
    var age: Int = 0
    var money: BigDecimal = BigDecimal.ZERO

    var normalUser: NormalUser? = null

    var list = ArrayList<ArrayList<String>>()

    constructor()
    constructor(id: Int, name: String?, age: Int, money: BigDecimal) : this() {
        this.id = id
        this.name = name
        this.age = age
        this.money = money
    }

    fun introduce(name: String, age: Int) {
        println("我叫：$name,我几年：$age 岁，这是一个介绍我自己的方法")
    }

    override fun toString(): String {
        return "User(id=$id, name=$name, age=$age, money=$money, normalUser=$normalUser, list=$list)"
    }


}


class NormalUser(private val wechatID: String, private val qq: Int) {
    override fun toString(): String {
        return "NormalUser(wechatID='$wechatID', qq=$qq)"
    }
}


class VipUser : User() {

    var address: String? = null
    var email: String? = null


    override fun toString(): String {
        return "VipUser"+super.toString() + "  VipUser(address=$address, email=$email)"
    }


}
